<template>
  <el-menu :router="true" :default-active="defaultActivePath" class="el-menu-vertical-demo" @open="handleOpen" @close="handleClose">
    <el-submenu index="1">
<<<<<<< HEAD
      <template slot="title"><i class="el-icon-location"></i>上传&&展示</template>
      <el-menu-item-group>
        <el-menu-item @click="goTo('Upload')">上传图片</el-menu-item>
        <el-menu-item @click="goTo('Show')">具体展示</el-menu-item>
=======
      <template slot="title"><i class="el-icon-location"></i>上传图片</template>
      <el-menu-item-group>
        <el-menu-item @click="goTo('Upload')">上传图片</el-menu-item>
>>>>>>> 4f96494e94bced33c9c43a9cb846f89719b8fbbf
      </el-menu-item-group>
    </el-submenu>

    <el-submenu index="2">
      <template slot="title"><i class="el-icon-location"></i>标记表格</template>
      <el-menu-item-group>
        <el-menu-item @click="goTo('Form')">标记表格</el-menu-item>
      </el-menu-item-group>
      <el-menu-item-group>
        <el-menu-item @click="goTo('FormAll')">获取表格</el-menu-item>
      </el-menu-item-group>
    </el-submenu>

    <el-submenu index="3">
      <template slot="title"><i class="el-icon-menu"></i>图片标记</template>
      <el-menu-item-group>
        <el-menu-item @click="goTo('All')">全部图片</el-menu-item>
        <el-menu-item @click="goTo('Record')">标记记录</el-menu-item>
        <el-menu-item @click="goTo('Finished')">已标记</el-menu-item>
        <el-menu-item @click="goTo('Unfinished')">未标记</el-menu-item>
        <el-menu-item @click="goTo('Lable')">标记图片</el-menu-item>
      </el-menu-item-group>
    </el-submenu>
    <el-submenu index="4">
      <template slot="title"><i class="el-icon-collection"></i>标签管理</template>
      <el-menu-item-group>
        <el-menu-item @click="goTo('Tags')">标签管理</el-menu-item>
      </el-menu-item-group>
    </el-submenu>
  </el-menu>
</template>

<script>
export default {
  name: "CommonAside",
  computed: {
    info() {
      return localStorage.getItem("info");
    },
    defaultActivePath() {
      return this.$route.path;
    },
  },
  methods: {
    handleOpen(key, keyPath) {
      console.log(key, keyPath);
    },
    handleClose(key, keyPath) {
      console.log(key, keyPath);
    },
    goTo(type) {
      if (this.info === 'eye') {
        this.$router.push({ path: 'eye' + type });
      } else if (this.info === 'palm') {
        this.$router.push({ path: 'palm' + type });
      } else if (this.info === 'tongue') {
        this.$router.push({ path: 'tongue' + type });
      }
<<<<<<< HEAD
    },
    go2Show(){
      this.$router.push({ path: show });
=======
>>>>>>> 4f96494e94bced33c9c43a9cb846f89719b8fbbf
    }
  }
}
</script>

<style scoped>
.el-menu-vertical-demo:not(.el-menu--collapse) {
  width: 200px;
  min-height: 400px;
}
</style>
